package Admin;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import Client.MyProfiles;
import Project_etow.LoginDialog;


public class AdminControl extends javax.swing.JFrame {

	private String accountid;
	private String groupname;
	
        public String getGroupname() {
		return groupname;
	}
	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}
	public String getAccountid() {
		return accountid;
	}

	public void setAccountid(String accountid) {
		this.accountid = accountid;
	}

	public AdminControl() {
        initComponents();
    }


    @SuppressWarnings("unchecked")

    private void initComponents() {
  
    	btgroupaccount = new javax.swing.JButton();
        btaccount = new javax.swing.JButton();
        btbill = new javax.swing.JButton();
        bttown = new javax.swing.JButton();
        btlogout = new javax.swing.JButton();
        btmyprofile = new javax.swing.JButton();
        
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new java.awt.FlowLayout());

        btgroupaccount.setText("Bill Payment");      
        getContentPane().add(btgroupaccount);
        btgroupaccount.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent arg0) {				
				BillPayment bp = new BillPayment(null, true);
				bp.setVisible(false);
			}
		});
        btaccount.setText("Account");
        getContentPane().add(btaccount);
        btaccount.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
			
				Account ac = new Account(null, true);
				ac.setAcccountedit1(getAccountid());				
				ac.setVisible(true);								
				
			}
		});
        
        btbill.setText("Bill");
        btbill.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				Payment pm = new Payment(null, true);
				pm.setVisible(true);
			}
		});
        getContentPane().add(btbill);
        
        bttown.setText("Town");
        getContentPane().add(bttown);
        bttown.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				
				
			}
		});
        btlogout.setText("LogOut");
        getContentPane().add(btlogout);
        btlogout.addActionListener(new ActionListener() {
            
            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
                LoginDialog lg = new LoginDialog(null, true);
                lg.setVisible(true);
                    
            }
    });
        
        btmyprofile.setText("MyProfiles");
        btmyprofile.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				MyProfiles mypro = new MyProfiles(null, true,getAccountid(),getGroupname());
				mypro.setVisible(true);
				
			}
		});
        getContentPane().add(btmyprofile);
        pack();
    }

    public static void main(String args[]) {
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(AdminControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(AdminControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(AdminControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(AdminControl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }

        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new AdminControl().setVisible(true);
            }
        });
    }

    private javax.swing.JButton btgroupaccount;
    private javax.swing.JButton bttown;
    private javax.swing.JButton btaccount;
    private javax.swing.JButton btlogout;
    private javax.swing.JButton btbill;
    private javax.swing.JButton btmyprofile;
}

